package com.lzy.system.business.dto;

import com.lzy.validator.StringMinMaxConstraint;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Getter;
import lombok.Setter;
import lombok.experimental.Accessors;

import javax.validation.Valid;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Pattern;

/**
 * <p>
 * 存储字段
 * </p>
 *
 * @author lcc
 * @since 2024-01-21
 */
@Getter
@Setter
@Accessors(chain = true)
@ApiModel(value = "SysBusEntityField新增dto", description = "存储字段")
@Valid
public class SysBusEntityFieldAddDTO {
    @ApiModelProperty("标题")
    @StringMinMaxConstraint(min = 1,max = 100,message = "标题长度必须在1-100之间")
    private String f_title;

    @ApiModelProperty("名称")
    @StringMinMaxConstraint(min = 1,max = 100,message = "名称长度必须在1-100之间")
    @Pattern(regexp = "^[a-z_0-9]+$", message = "只能输入小写英文字母和下划线")
    private String f_name;

    @ApiModelProperty("类型")
    @StringMinMaxConstraint(min = 1,max = 100,message = "类型长度必须在1-100之间")
    private String f_type;

    @ApiModelProperty("长度")
    @StringMinMaxConstraint(min = 1,max = 10,message = "长度长度必须在1-10之间")
    private String f_length;

    @ApiModelProperty("是否为空")
    @NotNull(message = "是否为空不能为空")
    private Boolean f_null;

    @ApiModelProperty("排序")
    private Integer order_index;

    @ApiModelProperty("字段描述")
    @StringMinMaxConstraint(min = 0,max = 255,message = "长度长度必须在0-255之间")
    private String f_desc;
}
